Increasingly, mobile wireless devices communicate messages over heterogeneous connections, in which one or more constituent links include a public network, such as the Internet. The Internet is a loosely-organized international collaboration of autonomous, interconnected, packet-based networks, including wireless networks, which can be represented by a hierarchical, multilayer architecture, service descriptions, and protocols. Communication endpoints, or hosts, can be interconnected over a network using packet-switching computers called routers. To communicate using the Internet, a host typically implements a protocol from at least one layer of an Internet protocol suite. Each host and router executes one or more programs, or processes, which perform various tasks including information communication, processing, and display. An application is a process that operates at the topmost layer of the Internet protocol suite, and that may use a lower-layer transport protocol to provide transport layer communication services across distinct, but interconnected, networks. In turn, a transport protocol typically employs a network protocol to facilitate message transfer over a network between communicating processes. At the lowest layers, messages can be logically and physically transformed, and transported as electromagnetic or electro-optic signals through the networking media.
The predominant group of protocols used on the Internet is the Transmission Control Protocol/Internet Protocol (TCP/IP) protocol suite. The Transmission Control Protocol (TCP) is a connection-oriented, end-to-end, full-duplex, transport protocol providing reliable interprocess communication between pairs of host computer processes. A full-duplex protocol permits concurrent communication between connected hosts. A reliable protocol is one that provides a mechanism by which sender and receiver exchange information, directly or indirectly, about a communication state, such as a message delivery. Generally termed an “acknowledgement,” or ACK, the mechanism may involve a variety of techniques, such as a formatted response, to convey the information desired for a given protocol. A connection-oriented protocol, TCP substantially assures message delivery by routing a bidirectional logical connection between communicating hosts over a network prior to data transmission, and communicates using messages of formatted data units, called TCP segments. An end-to-end protocol typically invests responsibility for communication integrity, security, and flow management in the communicating hosts, and not in intermediate gateways or routers. However, such end-to-end protocols can be disrupted by delays or interruptions in one of the intermediate links or routers, which connect the hosts. To improve robustness of the communication system, routers often use connectionless network-layer protocols, which forward each message, or data unit, independently of others.
Internet Protocol (IP) is a network protocol, in which each message is identified by a destination address, namely the destination host IP address. IP is a connectionless (stateless) protocol with no end-to-end segment delivery guarantees. Independently transmitted TCP segments may be forced to contend for the use of network resources as they are routed through the network, and may arrive at the destination host damaged, duplicated, out of order, or not at all. Thus, higher-layer processes, such as an application or TCP process, typically would assume responsibility to correctly receive, reorder, repair, acknowledge, and request re-transmission of, the segments, or messages, conveyed by IP. Implicitly, although TCP/IP can be a reliable, robust communication protocol suite, the actual flow of messages during a communication may be bursty, that is, subject to wide variations in the volume of messages being transmitted at a given moment. At one extreme, a surging message volume may temporarily exceed the ability of a host to receive and process messages. At another, substantial pause between consecutive messages during a period of diminished message may incorrectly indicate that communications have ceased or the intervening link has been terminated.
When an application program, or process, (e.g., HTTP) communicates with another host, using TCP/IP-like protocols, the transport-layer processes (e.g., TCP) on either endpoint connect with the respective application using an interface called a TCP socket, which includes an IP address and a TCP port number. An IP address usually is associated with a host, and a TCP port usually is associated with a particular communication function of a particular application process invoking the host transport process. By directing messages through a specific local host socket to a specific remote host socket, a local host is capable of communicating across a network with the remote host.
Typically, a communication buffer is created for each host socket, as a transport-layer connection is established between hosts. A communication buffer can be used to offset various irregularities and burstiness in message communication, arising from the nature of the communicating hosts, the methods used to communicate, and the conditions of the network connections intervening between the hosts. A buffer can be composed of multiple memory objects, which can be arranged in logical data structures and units, and disposed to store information therein. During the communication, messages may be read from, and written to, each buffer. An exemplary BUFFER READ can be an operation in which data is transferred from a buffer to an executing application (process); and an exemplary BUFFER WRITE can be an operation in which data is transferred from a process to a buffer.
TCP is one of many communication protocols, well-known in the network and communication arts, which attempt to assure message delivery using positive acknowledgement-based controls. In sender-initiated acknowledgement protocols, each sending endpoint of a communication, whether client or server, retains a copy of transmitted messages for possible re-transmission until the corresponding receiving endpoint ACKs the particular message. When the recipient acknowledges receipt, the sender may release the memory objects in which the retained copies are stored. If a proper acknowledgement is not received, the sending endpoint may re-transmit messages beginning at the point of the last proper ACK. Multiple messages, e.g., TCP segments, may be transmitted, with each sender accumulating copies of sent messages until corresponding ACKs are received. In view of the bursty nature of Internet communications, the ACK-related retention of previously transmitted messages, and the ability of hosts to transmit multiple messages, there may be a risk that either, or both, host can temporarily be overwhelmed by the number of segments being processed, received, and transmitted at a given time. During a communication, a remote host can function as a server to a client local host, and vice versa, with roles changing during the course of a communication. With full-duplex communications, hosts may communicate messages concurrently. However, a client or a server often cannot perform two transactions internally at once—for example, a BUFFER READ cannot be performed on a host buffer concurrently with a BUFFER WRITE, and vice versa. This aspect also may lend to a host being temporarily overwhelmed, for example, during a period of high message volume.
Relative to other communication systems, mobile devices are often memory-constrained, with limited available communication memory space. Such constraints may adversely affect flow control and buffer management under some conditions. For example, memory-constrained devices may be susceptible to message flow anomalies such as buffer deadlock and buffer starvation. Buffer deadlock may occur when an executing process waits for a resource that may never be available. Similarly, buffer starvation may occurs when an executing process under some circumstances, may block for a long period of time or forever waiting for a resource that may never be available. Certain mobile device application processes are configured to defer performing a BUFFER READ operation on a communication buffer until an in-progress BUFFER WRITE operation has completed. As such application processes execute, stored TCP segments can accumulate in both transmit and receive buffers of the mobile device, leading to exhaustion of the available communication memory space. With the memory space exhausted, the process may be unable to complete an in-progress BUFFER WRITE. At the same time, the application process awaits the completion of the BUFFER WRITE to perform a BUFFER READ operation. The stalemate that develops is termed a deadlock. Typically, for some period after a deadlock develops, the mobile device halts communication while keeping open the TCP connection. Many TCP protocols and processes can provide timeout mechanisms, in which the TCP connection between the mobile device and the server is closed after a predetermined timeout period, on the order of several seconds. Nevertheless, deadlock and TCP timeout mechanisms can waste substantial system resources, and it is desirable to reduce their occurrence.